{php}$_tags = array_filter(explode(' ', $content['tag']));{/php}
{if $_tags}
<p><b>相关文章</b></p>
{php}
	$_ids = \Ebcms::db() -> select('tag', 'content_id', [
		'tag'=>$_tags,
		'ORDER'=>[
			'id'=>'DESC'
		],
		'LIMIT'=>20
	]);

	$_contents = \Ebcms::db() -> select('content', '*', [
		'status'=>1,
		'id'=>array_unique($_ids),
		'ORDER'=>[
			'id'=>'DESC'
		]
	]);
{/php}
<ul>
	{foreach $_contents as $v}
	<li><a href="{:content_url($v)}">{$v.title?:'暂无标题'}</a></li>
	{/foreach}
</ul>
{/if}